package Practice04;

import java.util.Comparator;
import java.util.Objects;

public class Circle implements Comparable<Circle> {
    int radius;

    public Circle(int radius) {
        this.radius = radius;
    }

    @Override
    public int compareTo(Circle o) {

        //升序
        if (this.radius > o.radius){
            return 1;
        }else if (this.radius < o.radius){
            return -1;
        }
        return 0;
    }



    @Override
    public String toString() {
        return "Circle{" +
                "radius=" + radius +
                '}';
    }
}
